﻿using BasicInformationCommon.API.BasicInformationCommons.Suppliers;
using ERPSystem.Common.DTO;
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace BasicInformationCommon.API.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class PurchaseWarehousingController : ControllerBase
    {
        private readonly IMediator _mediator;

        public PurchaseWarehousingController(IMediator mediator)
        {
            _mediator = mediator;
        }
        /// <summary>
        /// 处理采购入库单查询请求
        /// </summary>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<Result<PageResultDto<PurchaseWarehousingDTO>>> GetPurchaseWarehousingList([FromQuery]PurchaseWarehousingSearchCommand request, CancellationToken cancellationToken)
        {
            return await _mediator.Send(request, cancellationToken);
        }
    }
}
